home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lantools
/
lantas10
/
ncb.int
< prev
next >
Wrap
Text File
|
1992-01-02
|
9KB
|
199 lines
{
╔════════════════════════════════════════════════════════════════════════╗
║ UNIT NCB ║
║ ║
║ Includefile for NCB-Datastructures ║
╟────────────────────────────────────────────────────────────────────────╢
║ Author : O. Rehmann ║
║ Compiler : Turbo Pascal 6.0 ║
║ OS : MS-DOS 5.0 ║
║ Last Edit : 02-01-1992 ║
║ Version : 1.0 ║
╚════════════════════════════════════════════════════════════════════════╝
}
UNIT NCB;
INTERFACE
USES DOS;
CONST NETBIOS_NAME_LEN = 16; { Length of a Netbios - Name }
NCBNAMSZ = NETBIOS_NAME_LEN;
NETBIOS_Int = $5C;
{══════════════════════════════════════════════════════════════════════}
{ Netbios Control Block NCB (structure definition) }
{══════════════════════════════════════════════════════════════════════}
TYPE
_NCB = RECORD
NCB_command : Byte; { command code }
NCB_retcode : Byte; { return code }
NCB_lsn : Byte; { local session number }
NCB_num : Byte; { number of our network name }
NCB_buffer : Pointer; { address of message buffer }
NCB_length : Word; { size of message buffer }
NCB_callname : Array[00..(NCBNAMSZ-1)] of Char; { blank-padded name of remote }
NCB_name : Array[00..(NCBNAMSZ-1)] of Char; { our blank-padded netname }
NCB_rto : Byte; { rcv timeout/retry count }
NCB_sto : Byte; { send timeout/sys timeout }
NCB_post : Pointer; { Async notification handle }
NCB_lana_num : Byte; { lana (adapter) number }
NCB_cmd_cplt : Byte; { 0xff => commmand pending }
NCB_reserve : Array[00..(14-1)] of Byte; { reserved, used by BIOS }
END; { _NCB }
NCB_NAME_STRING = String[NCBNAMSZ];
NCB_NAME_FIELD = Array [00..(NCBNAMSZ-1)] of Char;
VAR NETBIOS_INSTALLED : BOOLEAN; { True when NETBIOS is loaded }
DummyNCB : _NCB; { Dummy NCB used for installation check }
RECV_Timeout : BYTE; { Timeout values used for each call (def: 0) }
SEND_Timeout : BYTE;
NCBWAIT : BOOLEAN;
{══════════════════════════════════════════════════════════════════════}
{ Special values and constants (Commands & return-codes) }
{══════════════════════════════════════════════════════════════════════}
{══════════════════════════════════════════════════════════════════════}
{ NCB Commands (function-numbers) }
{══════════════════════════════════════════════════════════════════════}
CONST
{ ALL OF THESE FUNCTIONS DO A WAIT AFTER EXECUTING !!!!
You can call the same Function without a wait when adding $80 to
the function codes listet below !!!
There is a constant for this named ASYNC
If you use the functions defined below than you can set the boolean-
variable NCBWAIT to false or true.
FALSE means : there is no wait (ASYNC-Mode)
TRUE means : there is a wait ( SYNC-Mode, default)
Exception : RESET & CANCEL function
}
NCBCALL = $10; { NCB CALL }
NCBLISTEN = $11; { NCB LISTEN }
NCBHANGUP = $12; { NCB HANG UP }
NCBSEND = $14; { NCB SEND }
NCBRECV = $15; { NCB RECEIVE }
NCBRECVANY = $16; { NCB RECEIVE ANY }
NCBCHAINSEND = $17; { NCB CHAIN SEND }
NCBDGSEND = $20; { NCB SEND DATAGRAM }
NCBDGRECV = $21; { NCB RECEIVE DATAGRAM }
NCBDGSENDBC = $22; { NCB SEND BROADCAST DATAGRAM }
NCBDGRECVBC = $23; { NCB RECEIVE BROADCAST DATAGRAM }
NCBADDNAME = $30; { NCB ADD NAME }
NCBDELNAME = $31; { NCB DELETE NAME }
NCBRESET = $32; { NCB RESET }
NCBASTAT = $33; { NCB ADAPTER STATUS }
NCBSSTAT = $34; { NCB SESSION STATUS }
NCBCANCEL = $35; { NCB CANCEL }
NCBADDGRNAME = $36; { NCB ADD GROUP NAME }
NCBUNLINK = $70; { NCB UNLINK }
NCBSENDNA = $71; { NCB SEND NO ACK }
NCBCHAINSENDNA = $72; { NCB CHAIN SEND NO ACK }
NCBCALLNIU = $74; { UB special }
NCBRCVPKT = $78; { UB special }
NCBTRACE = $79; { Token-Ring protocol trace }
ASYNCH = $80; { high bit set == asynchronous }
{══════════════════════════════════════════════════════════════════════}
{ NCB return-codes (You can use these for result-checking) }
{══════════════════════════════════════════════════════════════════════}
{
NCB Return code
}
NRC_GOODRET = $00; { good return }
NRC_BUFLEN = $01; { illegal buffer length }
NRC_BFULL = $02; { buffers full, no receive issued }
NRC_ILLCMD = $03; { illegal command }
NRC_CMDTMO = $05; { command timed out }
NRC_INCOMP = $06; { message incomplete, issue another command }
NRC_BADDR = $07; { illegal buffer address }
NRC_SNUMOUT = $08; { session number out of range }
NRC_NORES = $09; { no resource available }
NRC_SCLOSED = $0a; { session closed }
NRC_CMDCAN = $0b; { command cancelled }
NRC_DMAFAIL = $0c; { PC DMA failed }
NRC_DUPNAME = $0d; { duplicate name }
NRC_NAMTFUL = $0e; { name table full }
NRC_ACTSES = $0f; { no deletions, name has active sessions }
NRC_INVALID = $10; { name not found or no valid name }
NRC_LOCTFUL = $11; { local session table full }
NRC_REMTFUL = $12; { remote session table full }
NRC_ILLNN = $13; { illegal name number }
NRC_NOCALL = $14; { no callname }
NRC_NOWILD = $15; { cannot put * in NCB_NAME }
NRC_INUSE = $16; { name in use on remote adapter }
NRC_NAMERR = $17; { called name cannot == name or name # }
NRC_SABORT = $18; { session ended abnormally }
NRC_NAMCONF = $19; { name conflict detected }
NRC_IFBUSY = $21; { interface busy, IRET before retrying }
NRC_TOOMANY = $22; { too many commands outstanding, retry later }
NRC_BRIDGE = $23; { ncb_bridge field not 00 or 01 }
NRC_CANOCCR = $24; { command completed while cancel occurring }
NRC_RESNAME = $25; { reserved name specified }
NRC_CANCEL = $26; { command not valid to cancel }
NRC_MULT = $33; { multiple requests for same session }
NRC_MAXAPPS = $36; { max number of applications exceeded }
NRC_NORESOURCES = $38; { requested resources are not available }
NRC_SYSTEM = $40; { system error }
NRC_ROM = $41; { ROM checksum failure }
NRC_RAM = $42; { RAM test failure }
NRC_DLF = $43; { digital loopback failure }
NRC_ALF = $44; { analog loopback failure }
NRC_IFAIL = $45; { interface failure }
NRC_ADPTMALFN = $50; { network adapter malfunction }
NRC_PENDING = $ff; { asynchronous command is not yet finished }
{ main user entry point for NetBIOS 3.0}
{
Maximum datagram size
}
MAX_DG_SIZE = 512;
FUNCTION NETBIOS_Present : Boolean;
{ General call : You must set all infos in your NCB except the Command }
FUNCTION NCB_EXECUTE(Command : Byte; VAR tNCB : _NCB) : Byte;
PROCEDURE NCB_CLEAR_BLOCK(VAR tNCB : _NCB);
FUNCTION NCB_LISTEN(VAR tNCB : _NCB) : Byte;
FUNCTION NCB_CALL(VAR tNCB : _NCB) : Byte;
FUNCTION NCB_ADD_NAME(VAR tNCB : _NCB;LocalName,RemoteName : NCB_NAME_STRING) : Byte;
FUNCTION NCB_DELETE_NAME(VAR tNCB : _NCB) : Byte;
FUNCTION NCB_HANG_UP(VAR tNCB : _NCB) : Byte;
FUNCTION NCB_SEND_BCST_DATAGRAM(VAR tNCB : _NCB;MSGSeg,MSGOfs,MSGLen : Word) : Byte;
FUNCTION NCB_RECV_BCST_DATAGRAM(VAR tNCB : _NCB;BUFSeg,BUFOfs,BUFLen : Word;UsrProc : Pointer) : Byte;
FUNCTION NCB_SEND_DATAGRAM(VAR tNCB : _NCB;MSGSeg,MSGOfs,MSGLen : Word) : Byte;
FUNCTION NCB_RECV_DATAGRAM(VAR tNCB : _NCB;BUFSeg,BUFOfs,BUFLen : Word;UsrProc : Pointer) : Byte;